home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 November: Tool Chest / Dev.CD Nov 00 TC Disk 2.toast / pc / sample code / overview / dave falkenburg's sprocket / docwindow.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-09-28  |  2.1 KB  |  77 lines

  1. /*
  2.     File:        DocWindow.h
  3.  
  4.     Contains:    A simple document window
  5.  
  6.     Written by: Dave Falkenburg    
  7.  
  8.     Copyright:    Copyright © 1993-1999 by Apple Computer, Inc., All Rights Reserved.
  9.  
  10.                 You may incorporate this Apple sample source code into your program(s) without
  11.                 restriction. This Apple sample source code has been provided "AS IS" and the
  12.                 responsibility for its operation is yours. You are not permitted to redistribute
  13.                 this Apple sample source code as "Apple sample source code" after having made
  14.                 changes. If you're going to re-distribute the source, we require that you make
  15.                 it clear in the source that the code was descended from Apple sample source
  16.                 code, but that you've made changes.
  17.  
  18.     Change History (most recent first):
  19.                 8/19/1999    Karl Groethe    Updated for Metrowerks Codewarror Pro 2.1
  20.                 9/4/94        DRF                Added scroll bars and revised dragging methods.
  21.  
  22. */
  23.  
  24. #ifndef        _DOCWINDOW_
  25. #define        _DOCWINDOW_
  26.  
  27. #ifndef        _WINDOW_
  28. #include    "Window.h"
  29. #endif
  30.  
  31. #ifndef        __THREADS__
  32. #include    <Threads.h>
  33. #endif
  34.  
  35. class    TDocWindow    :    public TWindow
  36.     {
  37. public:
  38.                             TDocWindow();
  39.     virtual                 ~TDocWindow();
  40.  
  41.     virtual WindowPtr        MakeNewWindow(WindowPtr behindWindow);
  42.  
  43.     virtual    void            AdjustCursor(EventRecord * anEvent);
  44.  
  45.     virtual void            Activate(Boolean activating);
  46.     virtual void            Draw(void);
  47.     virtual void            Click(EventRecord * anEvent);
  48.  
  49.     virtual void            AdjustForNewWindowSize(Rect * oldRect,Rect * newRect);
  50.  
  51.     virtual    Boolean            Close(void);
  52.     
  53.     virtual    OSErr            DragEnterWindow(DragReference theDrag);
  54.     virtual    OSErr            DragInWindow(DragReference theDrag);
  55.     virtual    OSErr            DragLeaveWindow(DragReference theDrag);
  56.     virtual    OSErr            HandleDrop(DragReference theDrag);
  57.  
  58. //    new methods
  59.  
  60.     virtual    void            DoControlAction(ControlHandle whichControl,short whichPart);
  61.     virtual void            SpinHeaderArrows();
  62.  
  63. protected:
  64.     static    unsigned long    fgUntitledTagCount;
  65.  
  66.     ControlHandle            fVerticalScroll,fHorizontalScroll;
  67.     Boolean                    fVerticalScrollActive,fHorizontalScrollActive;
  68.  
  69.     ThreadID                fSpinnerThreadID;
  70.     short                    fCurrentSpinningArrowIconID;
  71.  
  72.     RgnHandle                fDragTargetRgn;
  73.     Boolean                    fCanAcceptDrag;
  74.     };
  75.  
  76. #endif
  77.